import logging,yagmail
from datetime import datetime
class log():
    datime=datetime.now().strftime('%Y%m%d-%H%F%S')
    log=logging.basicConfig(filename=f'./{datime}.log',
                            level=logging.DEBUG,
                            filemode='a+',
                            format='%(levelname)s-> %(levelno)s-> %(fillname)-> %(asctime)s-> %(message)s')
class email():
    datime = datetime.now().strftime('%Y%m%d-%H%F%S')
    mail = yagmail.SMTP(user='1508523002@qq.com',password='dhelwmusixdcgdbb',host='smtp.qq.com',port='465')
    mail.send(to='1508523002@qq.com',subject=f'{datime}百度webui自动化测试报告',contents='测试报告',attachments=f'./{datime}.log')